<%@page import="com.wanmait.hotelManage.vo.Register"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
    
    <%
    	String path=request.getContextPath();
    	Register register=(Register)request.getAttribute("register");
    %>
<table id="tt" class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
                           <!--  <th>序号</th> -->
                            <th>id</th>
                            <th>房间号</th>
                            <th>房间类型</th>
                            <th>操作</th>
                        </tr>
                       <%  
                       	if(register!=null){
                        
                        	
                        	
                        	/* out.print(roomType); */
                        	%>
                        	
                        	<tr id="tr<%=register.getRoom().getId()%>">
                        	
                               <td class="tc"><input data-id="<%=register.getId() %>" class="choose" name="id[]" value="59" type="checkbox"></td>
                               
                                <td><%=register.getId() %></td>  
                               
                               <td><%=register.getRoom().getNumber() %></td>
                               <td><%=register.getRoom().getRoomtype().getTitle() %></td>
                                
                               <td class="tt">
                                   <%-- <a class="link-update" href="<%=path%>/manage/CheckOutServlet?action=updateInit&id=<%=register.getId()%>">修改</a> --%>
                                   <a class="link-del"  id="del<%=register.getRoom().getId()%>" href="#">退房</a>
                               </td>
                           </tr>
                        <% 	
                        }
                       
                       %>
                    </table>
                    
                    
     <jsp:include page="/manage/inc/footer.jsp"/>
<script>
	$(function() {               
                    
                    $(".link-del").click(function(){
				if(!window.confirm("确定要退房吗")){
					return false;
				}
				var id=$(this).attr("id").substring(3);
				$.ajax({
					url:"<%=path%>/manage/CheckOutServlet?action=delete",
					data:{roomId:id},
					success:function(msg){
						window.location.href="<%=path %>/manage/CheckOutServlet?action=list";
					}
				});
			})
			})